﻿using MediatR;
using RBAC.Common.Domains.RabbitProject;
using RBAC.Common.Dto;
using RBAC.Common.infrastructures.interfaces;
using RBAC.Enum;

namespace RBAC.api.Application.commond.culture
{
    public class GoodsSelectHander : IRequestHandler<GoodsSelectCommond, Rulst>
    {


        private readonly IbaseRpository<Goods> _Goods;

        public GoodsSelectHander(IbaseRpository<Goods> goods)
        {
            _Goods = goods;
        }

        public async Task<Rulst> Handle(GoodsSelectCommond request, CancellationToken cancellationToken)
        {
           

            var reault=new Rulst() { Code=(int)Reult.success};


            var list=_Goods.Query().ToList();
            if(list!=null)
            {
                reault.data = list;
                reault.MSG = "查询成功";
            }
            


            return reault;

        }
    }
}
